<?php
$image=$_GET["image"];
require_once 'AipOcr.php';

const APP_ID = '11337868';
const API_KEY = 'Axm4uwvMqh47cDQptkKuvNaL';
const SECRET_KEY = 'yAE7X5rgA9dHYRL6VvfweAyLj5sI5jU4';

$client = new AipOcr(APP_ID, API_KEY, SECRET_KEY);

// 调用通用文字识别, 图片参数为本地图片
//echo json_encode($client->basicGeneral($image));
// 如果有可选参数
 $options = array();
 $options["language_type"] = "CHN_ENG";
 $options["detect_direction"] = "true";
 $options["detect_language"] = "true";
 $options["probability"] = "true";

// // 带参数调用通用文字识别, 图片参数为本地图片
//echo json_encode($client->basicGeneral($image, $options),JSON_UNESCAPED_UNICODE);
$url = $image;
echo json_encode($client->basicGeneralUrl($url, $options),JSON_UNESCAPED_UNICODE);
?>